package tsi.trabalho.truco;

import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;

import tsi.trabalho.truco.outros.Mensageiro;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothServerSocket;
import android.bluetooth.BluetoothSocket;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

public class PreJogo extends Activity{
	
	Button button;
	
	Boolean pronto = false;
	
	//	private static ConnectThread mConnectThread;

	List<String> list = new LinkedList<String>();
	ListView listView;
	Bundle bundle;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_pre_jogo);
		
		button = (Button) findViewById(R.id.button1);


		Intent intent = getIntent();
		bundle = intent.getExtras();
		if(bundle.getBoolean("key"))
			list.add(bundle.getString("nome"));
		else
			list.add(bundle.getString("nome")+" adv");
		listView = (ListView) findViewById(R.id.listViewPreJogo);
		refresh();
	}

	public void refresh(){
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, list);
		listView.setAdapter(adapter);
	}

	public void jogar(View view){
		if(!pronto){
		button.setBackgroundColor(Color.GREEN);
		pronto = true;
		}else{
			button.setBackgroundColor(Color.GRAY);
			pronto = false;
		}
	}

	
	

//

}
